//
// Created on 2025/6/16.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef INSPIREFACETEST_HYFACEDETECTMANAGER_H
#define INSPIREFACETEST_HYFACEDETECTMANAGER_H
#include "inspireface/c_api/inspireface.h"
#include <string>

class HYFaceDetectManager {
public:
    // 构造函数 - 接收模型路径
    explicit HYFaceDetectManager(std::string bundlepath);

    // 析构函数
    ~HYFaceDetectManager();

    int8_t detect(uint8_t *src, int srcwidth, int srcheight, int *faceNumber, float *facequality, float *facex,
                  float *facey, float *facewidth, float *faceheight, float *faceroll, float *faceyaw,
                  float *facepitch, int *faceshakeLeft, int *faceshakeRight, int *facejawOpen, int *faceheadRaise,
                  int *facebBlink, int returnFaceImage, uint8_t **outRes, int *outImgWidth, int *outImgHeight);
    int BGRToRGBA(const uint8_t *bgrData, int width, int height, uint8_t **outRgbaData);
    void releaseHYFaceDetectManager();

private:
    HFSession session_;      // InspireFace会话句柄
    bool loadSourceSuccess_; // 是否成功加载资源
};

#endif // INSPIREFACETEST_HYFACEDETECTMANAGER_H
